import { Expose, Transform } from 'class-transformer';
import { formatUTCtoLocal } from 'src/utils/format';

export class ResponseUserDto {
  @Expose()
  id: number;

  @Expose()
  email: string;

  @Expose()
  name?: string;

  @Expose()
  @Transform(({ value }): string => {
    return formatUTCtoLocal(value);
  })
  createdAt: string; // 注意：这里类型是 string

  @Expose()
  @Transform(({ value }): string => {
    return formatUTCtoLocal(value);
  })
  updatedAt: string;
}
